﻿using System;
using System.Collections.Generic;

namespace 城市天然气管道风险管理与决策系统
{
    /// <summary>
    /// Class of Pipeline, Encapsulated pipeline information and related methods
    /// </summary>
    [Serializable]
    internal class Pipeline
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string StartLocation { get; set; }
        public string EndLocation { get; set; }
        public DateTime InvestTime { get; set; }
        public int OperYear { get; set; }
        public double Pressure { get; set; }
        public double Length { get; set; }
        public double Ability { get; set; }
        public string Medium { get; set; }
        public string Unit { get; set; }
        public string Remark_Base { get; set; }
        public bool Logo { get; set; }
        public double DesignThick { get; set; }
        public double RealThick { get; set; }
        public double Diameter { get; set; }
        public string Material { get; set; }
        public string Coating { get; set; }
        public int FixTime { get; set; }
        public double MaxPressure { get; set; }
        public int AccidentTime { get; set; }
        public string Remark_Status { get; set; }
        public List<AccidentInfo> Accidents;
        public List<FixInfo> Fixs;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="id">Id of Pipeline</param>
        /// <param name="name">Name of Pipeline</param>
        /// <param name="start">Start Loaction of Pipeline</param>
        /// <param name="end">End Location of Pipeline</param>
        public Pipeline(int id, string name, string start, string end)
        {
            Id = id;
            Name = name;
            StartLocation = start;
            EndLocation = end;

            Accidents = new List<AccidentInfo>();
            Fixs = new List<FixInfo>();
            FixTime = Fixs.Count;
            AccidentTime = Accidents.Count;
        }
    }
}
